import { axios } from '@/utils/request'

const api = {
  qu: '/examination/elqu',
  elrepo: '/examination/elrepo'
}

export function getElQuList (parameter) {
  console.log(parameter)
  return axios({
    url: api.qu + '/list',
    method: 'get',
    params: parameter
  })
}

/** 获取题库名称 **/
export function getQuName (parameter) {
  return axios({
    url: api.elrepo + '/getQuName',
    method: 'get',
    params: parameter
  })
}

export function infoQuEl (id) {
  return axios({
    url: api.qu + `/get/${id}`,
    method: 'get'
  })
}

export function saveElQu (parameter) {
  console.log(parameter)
  return axios({
    url: api.qu + (parameter.id > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delElQu (parameter) {
  return axios({
    url: api.qu + '/remove',
    method: 'post',
    params: parameter
  })
}

export const quExport = api.qu + '/export'
